﻿using System;

namespace ShapeCalculator
{
    // 长方形类
    public class Rectangle : IShape
    {
        public double Length { get; set; }
        public double Width { get; set; }

        public Rectangle(double length, double width)
        {
            Length = length;
            Width = width;
        }

        public double CalculateArea()
        {
            return Length * Width;
        }

        public bool IsValid()
        {
            return Length > 0 && Width > 0;
        }
    }
}